Skip to content

Conversation

@kinyoklion
Copy link
Member

@kinyoklion kinyoklion commented Nov 4, 2025

BEGIN_COMMIT_OVERRIDE
feat: Add support for ping stream.
fix: Expose polling configuration type.
END_COMMIT_OVERRIDE

The primary purpose of this PR is to add ping stream support to allow the flutter client SDK to work with relay proxy in streaming mode.

In order to add this functionality a bit of re-factoring has occurred. The core logic for doing a poll is now encapsulated into a "requestor". This ensures that the process used for making a poll in request to a "ping" event is using the same logic as a polling request.


Note

Adds SSE ping support that triggers a flags poll, extracting shared polling logic into a new Requestor and updating data sources and tests accordingly.

  • Data sources:
    • Streaming (streaming_data_source.dart): handle ping events; on ping, use Requestor to fetch all flags and emit DataEvent/StatusEvent; supports GET/REPORT; minor logging; exposes httpClientFactory for ping requests.
    • Polling (polling_data_source.dart): refactor to use Requestor for requests; compute method from useReport; fix poll reschedule delay calculation; expose httpClientFactory.
    • New: requestor.dart encapsulates polling request logic (URL building, headers/body, ETag handling, environment ID extraction, error mapping) and returns DataSourceEvent?.
  • Client wiring:
    • ld_common_client.dart: build a single PollingDataSourceConfig and pass it to StreamingDataSource for ping-driven polls.
  • Tests:
    • Update polling tests to new factory param; verify REPORT headers/body and URLs; confirm interval behavior and env ID extraction.
    • Add streaming ping tests: triggers poll on ping, handles 200/304/error/network cases, and verifies GET vs REPORT.
  • Misc:
    • .gitignore: ignore **/devtools_options.yaml.

Written by Cursor Bugbot for commit d7e211b. This will update automatically on new commits. Configure here.

@kinyoklion kinyoklion force-pushed the rlamb/ping-stream-support branch from 1e9486b to dccfd48 Compare November 4, 2025 21:53
**/coverage/
**/.flutter-plugins-dependencies
**/.flutter-plugins
**/devtools_options.yaml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but this file was created when using the flutter dev tools.

@kinyoklion kinyoklion force-pushed the rlamb/ping-stream-support branch 2 times, most recently from 2a28719 to bbcebc5 Compare November 4, 2025 22:17
@kinyoklion kinyoklion force-pushed the rlamb/ping-stream-support branch from bbcebc5 to 8f17351 Compare November 4, 2025 22:55
cursor[bot]

This comment was marked as outdated.

@kinyoklion kinyoklion force-pushed the rlamb/ping-stream-support branch from 8f17351 to 794c4fe Compare November 4, 2025 23:05
@kinyoklion kinyoklion force-pushed the rlamb/ping-stream-support branch from 794c4fe to 77a7bd0 Compare November 4, 2025 23:06
@kinyoklion
Copy link
Member Author

bugbot review

// we want to poll after 25 seconds.
final delay = Duration(
milliseconds: max(
milliseconds: min(
Copy link
Member Author

@kinyoklion kinyoklion Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated minor bug, this should have been min to match the described logic. max will always just be the polling interval.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no bugs!


@kinyoklion kinyoklion marked this pull request as ready for review November 4, 2025 23:08
@kinyoklion kinyoklion requested a review from a team as a code owner November 4, 2025 23:08
@kinyoklion kinyoklion merged commit 3f6fd2b into main Nov 5, 2025
8 checks passed
@kinyoklion kinyoklion deleted the rlamb/ping-stream-support branch November 5, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants